This invention relates to converting and downloading a printer data stream in one format to a printer specific format and particularly to printer data stream conversion where the available memory is limited.
Printer input data supplied by the intelligent printer data streams (IPDS), ASCII data streams, and others have inherent differences that make a one-pass conversion from one format to another difficult. If necessary to implement conversions with two-pass designs, the associated printer drivers may not be able to supply modern, high speed printers with print data fast enough to utilize the full printer speed capability.
For IPDS, all font and other printer resources required for a page must be loaded into the printer before any page text is loaded. In ASCII data streams, however, font requirements may be identified anywhere in a page. For example, emphasized printing (which requires a special font to be loaded into the printer) is turned on by ASCII control characters at the beginning of the text to be emphasized and turned off by another ASCII control character at the end of the text to be emphasized. This causes problems when converting to IPDS since all the fonts must be converted to IPDS and downloaded to the printer before any IPDS page data is downloaded.
A two-pass process is usually used for such conversions. A first pass scans the ASCII data stream and downloads the font and resource information. A second pass converts and downloads the page data to be printed. Two-pass processes, however, degrade the page output rate of high speed printers by always requiring two scans of the input data stream.
A one-pass conversion process requires sufficient memory capacity to store all the data to be printed on a page. For complex pages which may contain large, detailed images, considerable memory capacity is involved. For simple applications, as an example, at a resolution of 480 pels per inch, an 81/2.times.11 -inch page requires approximately 2.7 million bytes of storage. At 600 pels per inch, approximately 4.2 million bytes are required. These requirements are increased by other considerations. Small processors, e.g., personal computers or workstations, have smaller memory capacity than large, mainframe host computers and may not be able to store an entire page of print data
Printer data storage in the prior art is characterized by U.S. Pat. No. 5,129,050 which discloses reassignment of memory within a printer where font storage is assigned a priority lower than print data so that the latter can overlay the storage area of the former.
The placement of print or page data in a printer storage according to whether the fonts required are stored or not in the printer is disclosed in U.S. Pat. No. 5,113,355.
U.S. Pat. No. 4,745,560 discloses a raster scan page memory selecting fonts according to the position of a cursor in the page. U.S. Pat. Nos. 5,001,653; 4,627,749; 5,136,688; 4,694,405; 5,025,397; 4,954,968; and 4,881,180 disclose page composing systems, some with provision for including images. While suited to the purpose to which they are directed, all depend on having sufficient memory available to accomplish their purpose and do not therefore address the problem of operating in an environment where memory may be limited, e.g., in the use of small processor systems for composing pages.
In accordance with the invention, a page in a print data stream in a first format is scanned and resource data for controlling the printer and page data to be printed are converted to a second format. The page data is stored and the resource data is transferred to the printer. When the page is completely scanned, the page data is moved to the printer. If insufficient memory is available to store all the page data, the page data is discarded and not saved during the rest of the page scanning, but the resource data is transferred. At the end of the page, the page is rescanned while the page data sent to the printer and the resource data is discarded.
By using a data buffer queuing scheme, a single scan converts the input data stream storing font and resource data in a resource buffer and page data in a page buffer. When the resource buffer is full, the contents are transferred, i.e., downloaded, to the printer. When a complete page of data from the input file has been converted and all the resource buffers have been downloaded to the printer, the queued page buffers are downloaded.
Each page is started as a one-pass process and reverts to a two-pass process only in exceptional cases. By reverting to a two-pass process on a page-by-page basis, one exceptional page does not corrupt the entire conversion process.
This permits an input, e.g., ASCII, data stream to be converted in a single pass if there are sufficient buffers to store all the data to be printed on a page. If insufficient page buffers are available, the conversion is performed using a two-pass process. Therefore, a one-pass process is used where possible, having the advantage of faster conversion, and a two-pass process is used only when necessary because of memory constraints.